package com.bysj.service;

import java.sql.SQLException;

import com.bysj.dao.CommentDao;
import com.bysj.model.Comment;
import com.bysj.model.Reply;

public class CommentService {
	private CommentDao cDao = new CommentDao();

	public Comment getOrderComment(int orderId) {
		Comment vo = null;
		try {
			vo = cDao.getOrderComment(orderId);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return vo;
	}

	public boolean addComment(Comment vo) {
		try {
			cDao.addComment(vo);
		} catch (SQLException e) {
			e.printStackTrace();
			return false;
		}
		return true;
	}

	public Reply getCommentReply(int orderId) {
		Reply vo = null;
		try {
			vo = cDao.getCommentReply(orderId);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return vo;
	}

	public boolean addReply(Reply vo) {
		try {
			cDao.addReply(vo);
		} catch (SQLException e) {
			e.printStackTrace();
			return false;
		}
		return true;
	}

}
